package com.czk.gulimall.ware.dao;

import com.czk.gulimall.ware.entity.WareSkuEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品库存
 * 
 * @author chenzhangkun
 * @email 1052031630@qq.com
 * @date 2021-12-07 23:04:24
 */
@Mapper
public interface WareSkuDao extends BaseMapper<WareSkuEntity> {

    List<Long> listWareIdHasStock(@Param("skuId") Long skuId);

    long lockSkuStock(@Param("skuId") Long skuId,@Param("wareID") Long wareId, @Param("num") Integer num);

    void unLockStock(@Param("skuId") Long skuId,@Param("wareId") Long wareId, @Param("num") Integer num);

}
